package action.chap4;



import java.util.List;

import static java.util.Comparator.comparingInt;
import static java.util.stream.Collectors.toList;

/**
 * @ClassName Demo001
 * @Description Demo001
 * @Author 孙峰
 * @Date 2020/3/30 15:39
 * @Version 1.0
 */
public class Demo001 {
    public static void main(String[] args) {
        List<Dish> dishes = DishUtils.getListDish();

        dishes.stream()
                .filter(dish -> dish.getCalories() < 400)
                .sorted(comparingInt(Dish::getCalories))
                .map(Dish::toString)
                // 将name处理成List集合
                .collect(toList())
                .forEach(System.out::println);



    }


}
